#include <iostream>
#include <string>
#include <memory>
// #include "TcpServer.hpp"
#include "HttpServer.hpp"
#include "Log.hpp"

static void Usage(std::string proc)
{
    std::cout << "Usage:\n\t" << proc << " port" << std::endl;
}

int main(int argc, char *argv[])
{

    // // LOG(INFO, "你好");

    if (argc != 2)
    {
        Usage(argv[0]);
        exit(4);
    }
    // int port = atoi(argv[1]);

    // std::shared_ptr<HttpServer> svr(new HttpServer(port));
    int port = atoi(argv[1]);

    std::shared_ptr<HttpServer> svr(new HttpServer());
    svr->InitServer();
    svr->Loop();

    return 0;
}